﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DiscreteSimulation.RandomGeneration;
using DiscreteSimulation.Simulation;
using DiscreteSimulation.Util;

namespace DiscreteSimulation
{
    class Program
    {
        static void Main(string[] args)
        {
            bool choice = false;
            LCGPseudoRandomGenerator generator;

            Console.WriteLine("Would you like to define generator values? y - yes / n - no");
            choice = Console.ReadLine() == "y" ? true : false;

            if (choice)
            {
                double seed = 0.0;
                double modulus = 0.0;
                ulong multiplier = 0;
                ulong increment = 0;

                Console.WriteLine("Type seed");
                seed = Convert.ToDouble(Console.ReadLine());

                Console.WriteLine("Type modulus");
                modulus = Convert.ToDouble(Console.ReadLine());

                Console.WriteLine("Type multiplier");
                multiplier = Convert.ToUInt64(Console.ReadLine());

                Console.WriteLine("Type increment");
                increment = Convert.ToUInt64(Console.ReadLine());

                generator = new LCGPseudoRandomGenerator(seed, modulus, multiplier, increment);
            }
            else
            {
                generator = new LCGPseudoRandomGenerator();
            }

            int iterations = 0;

            Console.WriteLine("Type number of iterations");
            iterations = Convert.ToInt32(Console.ReadLine());

            DiscreteSimulator simulator = new DiscreteSimulator(iterations, generator);

            simulator.Simulate();
            simulator.PrintStatistics();
        }
    }
}
